import com.doit.doitdata.process.Preprocess
import org.apache.spark.sql.SparkSession

/**
  * Created by hunter.coder 涛哥  
  * 2019/4/22 11:12
  * 交流qq:657270652
  * Version: 1.0
  * 更多学习资料：https://blog.csdn.net/coderblack/
  * Description:
  **/
object LishuaiSnappy {

  def main(args: Array[String]): Unit = {
    val spark = SparkSession.builder().config("io.compression.codecs","org.apache.hadoop.io.compress.SnappyCodec")
      .enableHiveSupport()
      .appName(Preprocess.getClass.getSimpleName)
      .master("local")
      .getOrCreate()

    val path = args(0)

    /*val ds= spark.read.textFile(path)
    ds.show(10,false)*/

    val sc = spark.sparkContext

    sc.textFile(path).take(10).foreach(println)

    spark.close()

  }

}
